{% extends "./base.html" %}
{% block title %}Search{% endblock %}
{% block content %}
<style type="text/css">
	li
	{
		border-color: black;
		border-width: 1px;
		border-style: solid;
	}
</style>

<div id="send">
	<form action="/messages" method="post">
		<label for="recipient">Recipient:</label> <input type="text" id="recipient" name="recipient" value="{{ recipient }}" />
		<br />
		<label for="message">
		<br />
		<textarea name="message" id="message"></textarea>
		<input type="hidden" name="token" value="{{ token }}" />
		<input type="submit" />
	</form>
</div>

<div id="messages">
	<ul style="list-style-type: none">
		{% for m in messages %}
			{% if m.sender == user %}
				<li><a href="messages/{{ m.thread_id }}">{{ m.item.title }}--{{ m.recipient }}</a></li>
			{% else %}
				<li><a href="messages/{{ m.thread_id }}">{{ m.title }}--{{ m.sender }}</a></li>
			{% endif %}
		{% endfor %}
	</ul>
</div>
{% endblock %}
